package com.wj.controller;


import com.wj.pojo.CustomWorks;
import com.wj.pojo.SeriesWorks;
import com.wj.service.ISeriesWorksService;
import com.wj.utils.RespUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wj
 * @since 2022-05-20
 */
@RestController
@RequestMapping("/series/works")
public class SeriesWorksController {
    @Autowired
    private ISeriesWorksService seriesWorksService;

    @GetMapping("/searchWorks")
    public RespUtil searchWorks(String searchText){
        System.out.println("-----------"+searchText);
        return seriesWorksService.searchWorks(searchText);
    }

    @GetMapping("/getSeries")
    public RespUtil getSeries(String seriesName) {
        return seriesWorksService.getSeries(seriesName);
    }

    @GetMapping("/")
    public List<SeriesWorks> getAllSeries() {
        return seriesWorksService.list();
    }
}
